package com.example.demo;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.listener.ChannelTopic;

public class RedisPubT extends DemoApplicationTests {

	@Autowired
	private RedisTemplate redisTemplate;

	private ChannelTopic topic = new ChannelTopic("/redis/pubsub");

	@Test
	public void publish() {
		String message = "findbyId:1";
		redisTemplate.convertAndSend(topic.getTopic(),message);
	}
}
